using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace SalienceEngineDemo
{
    class TwoToneLabel : Label
    {
        public TwoToneLabel() : base()
        {

        }

        public TwoToneLabel(Color c)
            : base()
        {
            m_backColor2 = c;
        }

        public Color SecondBackColor
        {
            get { return m_backColor2; }
            set { m_backColor2 = value; }
        }

        protected Color m_backColor2;

        protected override void OnPaintBackground(PaintEventArgs pevent)
        {
            Rectangle TopBox = new Rectangle(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height / 2);
            //TopBox.Intersect(pevent.ClipRectangle);
            Rectangle BottomBox = new Rectangle(ClientRectangle.X, ClientRectangle.Y + (ClientRectangle.Height / 2), ClientRectangle.Width, (ClientRectangle.Height + 1) / 2);
            //BottomBox.Intersect(pevent.ClipRectangle);
            pevent.Graphics.FillRectangle(new SolidBrush(BackColor), TopBox);
            pevent.Graphics.FillRectangle(new SolidBrush(m_backColor2), BottomBox);
        }
    }
}
